import instance from "@/axios";

// export  function getCode(){
//     let resp = instance.get('/captcha');
//     return resp
// }

// 获取验证码的接口   ()=>{}   res=>{ }
export const getCode = () => instance.get('/captcha')

// 登录  post请求时 会将参数以json格式传递
export const login = (user) => instance.post('/user/login', user)

// 获取用户分页数据
export const userList = (searchForm) => instance.post("/user/page", searchForm)

// 添加  /user/add
export const addUser = (userForm) => instance.post("/user/add", userForm)

// 根据id 获取用户信息
export const getById = (uid) => instance.get("/user/getById/"+uid)

// 根据用户id  编辑用户信息  json
export const editUser = (user) => instance.put("/user/edit/",user)

// 根据用户id  修改用户密码
export const resetPassword = (uid) => instance.put("/user/resetPassword/"+uid)

// 用户状态修改
export const changeState = (uid,state) => instance.put("/user/state/"+uid+"/"+state)

// 删除用户信息  /user/delete
export const batchDelete = (uids)=>instance.delete("/user/delete/",{data:uids})

// 获取个人信息
export const getPersonalInfo = ()=>instance.get("/user/personal/")

// 编辑个人信息
export const editPersonalInfo = (user)=>instance.put("/user/editPersonal/",user)

// 修改个人密码
export const editPersonalPassword = (pwd)=>instance.put("/user/editPersonalPwd/",pwd)

// 退出登录
export const logout = ()=>instance.get("/user/logout/")


// 获取用户的菜单
export const userMenu = ()=>instance.get("/user/menu/")
















